home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / tcwind16 / window.h < prev    next >
Text File  |  1987-07-08  |  6KB  |  198 lines

  1.                   /* Header File For Window Routines*/
  2.                   /* copywrite (C)1987 by D.R.EVANS */
  3.  
  4.  
  5.                          /* color defines */
  6. #define BLACK 0
  7. #define BLUE 1
  8. #define GREEN 2
  9. #define CYAN 3
  10. #define RED 4
  11. #define MAGENTA 5
  12. #define BROWN 6
  13. #define LIGHTGRAY 7
  14. #define DARKGRAY 8
  15. #define LIGHTBLUE 9
  16. #define LIGHTGREEN 10
  17. #define LIGHTCYAN 11
  18. #define LIGHTRED 12
  19. #define LIGHTMAGENTA 13
  20. #define YELLOW 14
  21. #define WHITE 15
  22. #define BLINK 128
  23. #define black BLACK
  24. #define blue BLUE
  25. #define green GREEN
  26. #define cyan CYAN
  27. #define red RED
  28. #define magenta MAGENTA
  29. #define brown BROWN
  30. #define lightgray LIGHTGRAY
  31. #define dark gray DARKGRAY
  32. #define lightblue LIGHTBLUE
  33. #define lightgreen LIGHTGREEN
  34. #define lightcyan LIGHTCYAN
  35. #define lightred LIGHTRED
  36. #define lightmagenta LIGHTMAGENTA
  37. #define yellow YELLOW
  38. #define white WHITE
  39. #define blink BLINK
  40.  
  41.                          /* var. defines */
  42. #define TRUE 1
  43. #define FALSE 0
  44. #define ON 1
  45. #define OFF 0
  46. #define TOP 0
  47. #define BOTTOM 1
  48. #define LEFT 0
  49. #define RIGHT 1
  50. #define CENTER 2
  51. #define UP 6
  52. #define DOWN 7
  53. #define HORNZ 0
  54. #define VERT 1
  55. #define MORE 0
  56. #define PRET 1
  57. #define MAXWIND 30 /* maximum number of windows allowed (depends on memory)*/
  58. #define top TOP
  59. #define bottom BOTTOM
  60. #define left LEFT
  61. #define right RIGHT
  62. #define center CENTER
  63. #define up UP
  64. #define down DOWN
  65. #define hornz HORNZ
  66. #define vert VERT
  67. #define more MORE
  68. #define pret PRET
  69. #define off OFF
  70. #define on ON
  71. #define nobrdr  0  /* no border */
  72. #define dblbrdr 1  /* double border */
  73. #define sglbrdr 2  /* single border */
  74. #define dtpbrdr 3  /* double top & bottom, single sides */
  75. #define dsdbrdr 4  /* doble sides, single top and bottom */
  76. #define sldbrdr 5  /* solid border in color specified */
  77. #define sglline 0  /* single line define for mline routine */
  78. #define dblline 1  /* double line define for mline routine */
  79. #define sldline 2  /* solid line define for mline routine */
  80. #define NOBRDR nobrdr
  81. #define DBLBRDR dblbrdr
  82. #define SGLBRDR sglbrdr
  83. #define DTPBRDR dtpbrdr
  84. #define DSDBRDR dsdbrdr
  85. #define SLDBRDR sldbrdr
  86. #define SGLLINE sglline
  87. #define DBLLINE dblline
  88. #define SLDLINE sldline
  89. #define color40 1 /* 40 col. color mode */
  90. #define color80 3 /* 80 col. color mode */
  91. #define COLOR40 color40
  92. #define COLOR80 color80
  93. #define BS 8
  94. #define FORMFEED 12
  95. #define CR 13
  96. #define ESC 27
  97. #define HOMEKEY 327
  98. #define ENDKEY 335
  99. #define UPKEY 328
  100. #define DOWNKEY 336
  101. #define PGUPKEY 329
  102. #define PGDNKEY 337
  103. #define LEFTKEY 331
  104. #define INSKEY 338
  105. #define RIGHTKEY 333
  106. #define DELKEY 339
  107. #define CTRLLEFTKEY 371
  108. #define CTRLRIGHTKEY 372
  109. #define F1 315
  110. #define F2 316
  111. #define F3 317
  112. #define F4 318
  113. #define F5 319
  114. #define F6 320
  115. #define F7 321
  116. #define F8 322
  117. #define F9 323
  118. #define F10 324
  119.  
  120.                     /* function prototypes */
  121.  
  122.   /* setup window params. must be called before any of the functions below */
  123. void initwindow(void);
  124.  
  125. void clrwind(unsigned char backgrd);
  126. void clrscr(unsigned char backgrd, unsigned char border);
  127. void screenmode(int mode);
  128. void setcursor(char turnon);
  129. void wtitle(unsigned char justify,unsigned char loc,
  130.                  unsigned char color,char *header);
  131. void mwind(int x1, int y1, int x2, int y2,
  132.               int windcolor,int brdrcolor,int brdrsel);
  133. void rwind(void);
  134. void mbox(int x1, int y1, int x2, int y2, int brdrcolor,int brdrsel);
  135. void mline(int col, int row, int length, int color, int linedir, int linetype);
  136. void pwindf(int col, int row,int color, va_list arg_list, ...);
  137. void pwindfc( int row, int color, va_list arg_list, ...);
  138. void movwind(int newcol, int newrow);
  139. void gowindcr( int col, int row);
  140. void waitkey(int typeprint);
  141. int keyin(void);
  142. char attr(unsigned char foregrd,unsigned char backgrd);
  143. char pullmenu(int loc, int menunum);
  144. char popupmenu(int col, int row, char *windowstrptr, int btype);
  145.  
  146. /* borlands direct video write routine supplied with turbo C requires link to
  147.    mcmvsmem.obj */
  148. void far movescreenmem(char far *source, char far *dest, unsigned len,
  149.  int snowcheck);
  150.  
  151.  
  152. #if defined(MAIN)
  153.  
  154. char shadow;   /* TRUE= shadow to right of window */
  155. char snow;     /* TRUE= slow screen writes eliminate snow */
  156. int scrmode;   /* 40 or 80 cols. */
  157. int rowend;    /* convieient variable to print at last row, causes scroll */
  158. int bordercolor; /* current window border color */
  159. int windowcolor; /* current window inside color */
  160. int pullmenuloc; /* return loc in pull menu upon return */
  161. unsigned char *pullmainmenu[7]; /* main menu pointers  */
  162. unsigned char *pullsubmenu[7][7]; /* sub menu pointers */
  163.  
  164. #endif
  165.  
  166.  
  167. /* These external variables are declared in windX.obj
  168.    Default is :
  169.                currentwindow = 0;
  170.                plcolor       = attr(yellow,blue);
  171.                plhicolor     = attr(white,black);
  172.                pletcolor     = attr(cyan,blue);
  173.                pbrdcolor     = attr(white,black);
  174. */
  175. extern int currentwind; /* current active window */
  176. extern int plcolor;     /* pull down menu main color */
  177. extern int plhicolor;   /* pull down menu hi lited color */
  178. extern int pletcolor;   /* pull down & popup menu letter selection color */
  179. extern int pbrdcolor;   /* pull down menu boarder colors */
  180. extern int ispullmenu;
  181. extern int ispulled;
  182.  
  183.  
  184. /* following variables are defined in the window object files. These Do not */
  185. /* have to be defined outside of that file. Listed here for your information */
  186.  
  187. extern char border[6][7];
  188. extern char colortable[128];
  189. extern char colorcard;
  190. extern char far *videoptr;
  191. extern unsigned char far* scrsave[MAXWIND];
  192. extern int windcolstart[MAXWIND], windcolend[MAXWIND];
  193. extern int windrowstart[MAXWIND], windrowend[MAXWIND];
  194. extern int windattr[MAXWIND];
  195. extern int bordattr[MAXWIND];
  196. extern int bordsel[MAXWIND];
  197.  
  198.